#ifndef __SOUNDMANAGER__
#define __SOUNDMANAGER__

#include "Header.h"


struct RIFF_Header {
	char chunkID[4];
	long chunkSize;//size not including chunkSize or chunkID
	char format[4];
}; 

struct WAVE_Format {
	char subChunkID[4];
	long subChunkSize;
	short audioFormat;
	short numChannels;
	long sampleRate;
	long byteRate;
	short blockAlign;
	short bitsPerSample;
};

struct WAVE_Data {
	char subChunkID[4]; //should contain the word data
	long subChunk2Size; //Stores the size of the data block
};

bool loadWavFile(char* filename, unsigned char* data, ALsizei* size, ALsizei* frequency, ALenum* format);

class SoundManager
{
private:
	ALCdevice* m_pDevice;
	ALCcontext* m_pContext;
public:
	ALuint Load(char* file_name);
	void Play(ALuint source, bool loop);
	void Pause(ALuint source);
	void Stop(ALuint source);
	bool isPlaying(ALuint source);

	SoundManager();
	~SoundManager();
};

#endif